package com.ywk.pattern._20_iterator;

public class Main {
    public static void main(String[] args) {

        ConcreteAggregate aggregate = new ConcreteAggregate();


        aggregate.insert(0, "����");
        aggregate.insert(0, "С��");
        aggregate.insert(0, "�ɸ�");
        aggregate.insert(0, "���");
        aggregate.insert(0, "�ݸ�");

      //  ConcreteIterator iterator = new ConcreteIterator(aggregate);
        Iterator iterator = new ConcreteIteratorDesc(aggregate);
        Object item = iterator.first();
        while (!iterator.isDone()) {
            System.out.println("��Ʊ" + iterator.currentItem());
            iterator.next();
        }
    }
}
